package com.hopes.bizz.risk.statistic.controller;

import cn.allbs.common.utils.R;
import com.hopes.bizz.risk.common.constant.GisRequestEnums;
import com.hopes.bizz.risk.statistic.serivce.ParkGisService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yumr
 * @ProjectName bizz
 * @Description 园区双重预防一张图
 * @time 2023/11/13 9:43
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/parkGis" )
@Tag(description = "parkGis" , name = "园区双重预防一张图" )
public class ParkGisController {

    private final ParkGisService parkGisService;

    @GetMapping(value = "/basicInfo")
    @Operation(summary = "双重预防数据-基本信息统计", description = "双重预防数据-基本信息统计")
    public R basicInfo() {
        return R.ok(parkGisService.basicInfo());
    }

    @GetMapping(value = "/objectLevel")
    @Operation(summary = "双重预防数据-风险分析对象等级", description = "双重预防数据-风险分析对象等级")
    public R riskObjectLevel() {
        return R.ok(parkGisService.riskObjectLevel());
    }

    @GetMapping(value = "eventLevel")
    @Operation(summary = "双重预防数据-风险事件等级", description = "双重预防数据-风险事件等级")
    public R riskUnitEventLevel() {
        return R.ok(parkGisService.riskUnitEventLevel());
    }


    @GetMapping(value = "hiddenLevel/{type}")
    @Operation(summary = "双重预防数据-隐患级别", description = "双重预防数据-隐患级别")
    public R riskHiddenLevel(@PathVariable("type") GisRequestEnums.GisCalEnum gisCalEnum) {
        return R.ok(parkGisService.riskHiddenLevel(gisCalEnum));
    }

}
